Verifying Reference Counted Objects

نویسندگان

  • Michael Emmi
  • Ranjit Jhala
  • Rupak Majumdar
چکیده

Reference counting is a pervasive resource management idiom where each resource contains a count of the number of clients that hold a reference to it, and each client increments (resp., decrements) the count on acquiring (resp., releasing) the resource. If the reference count falls to zero, the system can reclaim the resource. Reference counting is often a source of subtle bugs, ranging from leaked resources (when the reference count is positive even though there are no clients) to memory corruption (when a resource is reclaimed, but an old client reads or writes the resource based on an old handle). Static reasoning about reference counts is especially challenging as correctness depends on precise reasoning about arbitrarily many concurrent processes (clients of the resources) and arbitrarily many dynamically allocated and deallocated resources. We present a static analysis algorithm to verify correct use of reference counted objects. Our analysis performs compositional verification through the combination of symbolic temporal case splitting and predicate abstraction-based reachability analysis. Temporal case splitting reduces the verification of unboundedly many processes and resources to a finite number of processes and resources through the use of Skolem variables. The finite state instances can be discharged using abstract reachability, using an auxiliary invariant that correlates the reference count with the number of clients holding the resource at any given time. We have implemented our algorithm in REFEREE , an analyzer for correct use of reference counted objects in C programs, and are applying the algorithm to two case studies: a memory allocator in an OS kernel, and the Yaffs file system, each about 200 lines of code. In both cases, we expect our algorithm can prove correct use of reference counts within minutes.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Finding Reference-Counting Errors in Python/C Programs with Affine Analysis

Python is a popular programming language that uses reference counting to manage heap objects. Python also has a Foreign Function Interface (FFI) that allows Python extension modules to be written in native code such as C and C++. Native code, however, is outside Python’s system of memory management; therefore extension programmers are responsible for making sure these objects are reference coun...

متن کامل

LTL Model Checking for Systems with Unbounded Number of Dynamically Created Threads and Objects

One of the stumbling blocks to applying model checking to a concurrent language such as Java is that a program’s data structures (as well as the number of threads) can grow and shrink dynamically, with no fixed upper bound on their size or number. This paper presents a method for verifying LTL properties of programs written in such a language. It uses a powerful abstraction mechanism based on 3...

متن کامل

Bubble Algorithm for the Reduction of Reference

A vast majority of algorithms for the condensation of the reference set requires a great number of computations in case of processing a very large set, one that contains several dozens of objects. This fact formed the grounds for the presented attempt to develop a completely new classifier, an algorithm which would not only maintain the quality of classification similar to one obtained with the...

متن کامل

Rely-Guarantee References for Refinement Types

Reasoning about side effects and aliasing is the heart of verifyingimperative programs. Unrestricted side effects through one refer-ence can invalidate assumptions about an alias. We present a newtype system approach to reasoning about safe assumptions in thepresence of aliasing and side effects, unifying ideas from referenceimmutability type systems and rely-guarantee progr...

متن کامل

Modular Typestate Verification of Aliased Objects

A number of type systems have used typestates to specify and statically verify protocol compliance. Aliasing is a major challenge for these systems. This paper proposes a modular type system for a core object-oriented language that leverages linear logic for verifying compliance to more expressive protocol specifications than previously supported. The system improves reasoning about aliased obj...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:

دوره   شماره 

صفحات  -

تاریخ انتشار 2007